<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
	<head>
		<html:base />
		<title>Letter I Received</title>
		<link href="form/login.css" rel="stylesheet" type="text/css">
	</head>
  
	<body>
		<logic:notPresent name="userid" scope="session">
           	<logic:redirect forward="login_error"></logic:redirect>
		</logic:notPresent>
		<logic:present name="admin" scope="session">
			<logic:redirect forward="illegal_access"></logic:redirect>
		</logic:present>
		<logic:present name="ban" scope="session">
			<logic:redirect forward="ban_error"></logic:redirect>
		</logic:present>
		<logic:notPresent name="letter_list" scope="request">
			<logic:redirect page="/illegal_access.jsp"></logic:redirect>
		</logic:notPresent>
		<div class="container">
			<div class="header">
				<html:img page="/yssz.jpg"/>
				<div id="login">
					<html:link page="/view_letter.jsp">letter center</html:link>
				</div>
			</div>
			<div class="content">
				<h1>Letter I Received</h1>
				<p>
					<html:link action="sendLetterPre">send letter</html:link><br>
					<html:link action="viewFrom">letters I sent</html:link>
				</p>
				<table width="970px" border="1" cellspacing="0" cellpadding="0">
					<tr>
						<th>id</th>
						<th>from</th>
						<th>content</th>
						<th>time</th>
						<th>read</th>
					</tr>
					<logic:iterate id="letters" name="letter_list" scope="request">
						<tr>
							<td align="center"><bean:write name="letters" property="letterid"/></td>
							<td align="center"><bean:write name="letters" property="fromname"/></td>
							<td align="center"><bean:write name="letters" property="content"/></td>
							<td align="center"><bean:write name="letters" property="create"/></td>
							<td align="center"><bean:write name="letters" property="status"/></td>
						</tr>
					</logic:iterate>
				</table>
			</div>
			<div class="footer">
				<p>copyright@yssz</p>
			</div>
		</div>
	</body>
</html:html>
